package com.viser.partyinrs.entities;

import java.io.Serializable;

public class Korisnik implements Serializable, Comparable<Korisnik>{
	private static final long serialVersionUID = 1000003L;
	
	// Konstante za tip korisnika
	public static final int OBICAN = 0;
	public static final int MANAGER = 1;
	public static final int ADMINISTRATOR = 2;
	//
	
	public String ime = "";
	public String prezime = "";
	public String username = "";
	public String password = "";
	public int tip = OBICAN;
	public String urlSlike;
	int id;
	
	public Korisnik()
	{
		super();
	}
	
	public Korisnik(String ime, String prezime, String username, String password, int tip, String urlSlike, int id)
	{
		super();
		this.ime = ime;
		this.prezime = prezime;
		this.username = username;
		this.password = password;
		this.tip = tip;
		this.urlSlike = urlSlike;
		this.id = id;
	}
	
	@Override	
	public int compareTo(Korisnik drugi) {
		String imePrezime = prezime + " " + ime;
		return imePrezime.compareTo(drugi.prezime + " " + drugi.ime);
	}
}
